package service;

import java.util.List;

import pojos.Score;
import comm.Pagination;
import dao.ScoreDao;

public class ScoreServiceImpl implements ScoreService {
	
	private ScoreDao scoreDao;
	
	

	public ScoreDao getScoreDao() {
		return scoreDao;
	}

	public void setScoreDao(ScoreDao scoreDao) {
		this.scoreDao = scoreDao;
	}

	@Override
	public Score getById(Integer id) {
		return scoreDao.getById(id);
	}

	@Override
	public void saveOrUpdateScore(Score score) {
		scoreDao.saveOrUpdate(score);
	}

	@Override
	public void removeScore(Score score) {
		scoreDao.delete(score);
	}

	@Override
	public void removeScoreById(Integer id) {
		scoreDao.deleteById(id);
	}

	@Override
	public List<Score> findByStudentId(Integer stuId, Pagination pagination) {
		return scoreDao.findByStudentId(stuId, pagination);
	}

	@Override
	public List<Score> findByExamId(Integer examId, Pagination pagination) {
		return scoreDao.findByExamId(examId, pagination);
	}

}
